Skip to content

ID-45: Improve session compare csv file#780

Open
karlnaden wants to merge 4 commits into
mainfrom
id-45-improve-session-compare
Open

ID-45: Improve session compare csv file#780
karlnaden wants to merge 4 commits into
mainfrom
id-45-improve-session-compare

Conversation

@karlnaden
Copy link
Copy Markdown
Contributor

@karlnaden karlnaden commented May 11, 2026

Summary

Previously, the expected and actual messages columns of the comparison csv generated by the session compare CLI when the compared session does not match the expected results did not always contain helpful details and often cells were too long. Specifically, extra messages would throw off the comparison and data in a single cell could go over the csv line limit. Now, three enhancements make the output more usable:

  • The comparison is more robust and handles extra messages without throwing off other comparisons
  • Multiple duplicate normalized messages are now collapsed into a single entry with an indicator of how many there are.
  • by default, only different messages, meaning messages that weren't present in the expected but were in the actual and vice-versa are displayed. There is a new flag on both the session compare and execute_script CLI commands to revert this behavior.

Testing Guidance

To see this in practice, manually edit a messages element in an expected results json of an execution script and run the script to see the differences. Here's one example:

  1. Edit execution_scripts/validator/validator_suite_with_file_input_expected.json by replacing the messages element of the result entry with test_id value "dev_validator-patient_group-patient_validate_test" with the following
        [
           {
               "message": "ADDED",
               "type": "warning"
           },
           {
               "message": "Patient/85: Patient.extension[0].extension[0].value.ofType(Coding): The definition for the Code System with URI 'urn:oid:2.16.840.1.113883.6.238' doesn't provide any codes so the code cannot be validated",
               "type": "info"
           },
           {
               "message": "ADDED",
               "type": "warning"
           },
           {
               "message": "Patient/XX: Patient.extension[1].extension[0].value.ofType(Coding): The definition for the Code System with URI 'urn:oid:2.16.840.1.113883.6.238' doesn't provide any codes so the code cannot be validated",
               "type": "info"
           },
           {
               "message": "Patient/85: Patient.identifier[2].type: None of the codings provided are in the value set 'IdentifierType' (http://hl7.org/fhir/ValueSet/identifier-type|4.0.1), and a coding should come from this value set unless it has no suitable code (note that the validator cannot judge what is suitable) (codes = http://terminology.hl7.org/CodeSystem/v2-0203#SS)",
               "type": "warning"
           },
           {
               "message": "ADDED",
               "type": "warning"
           }
       ]
  1. Start inferno services and the test kit
  2. Execute the script corresponding to the updated results file bundle exec inferno execute_script execution_scripts/validator/validator_suite_with_file_input.yaml
  3. It should result in a different result and generate the csv comparison file in the same directory as the expected results file.
  4. Examine the csv comparison file and confirm that
  • The 3 "Added" messages are collapsed into a single row in the expected column (weren't present in the actual)
  • The only other message entries is the line with the patient id changed from 85 to XX - the other rows with the patient ids left the same will not be present.
  1. Run the session compare CLI with the option to include only different messages off: find the session id in the output of the execute script command and run bundle exec inferno session compare <session id> -m -r -f execution_scripts/validator/validator_suite_with_file_input_expected.json
  2. This should result in a different result and generate the csv comparison file in the same directory as the expected results file.
  3. Examine the csv comparison file and confirm that it is the same as above, but with entries for the rows where the patient id wasn't changed in the expected file.

@codecov
Copy link
Copy Markdown

codecov Bot commented May 11, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 84.78%. Comparing base (c616e2a) to head (e526aee).

Additional details and impacted files
@@           Coverage Diff           @@
##             main     #780   +/-   ##
=======================================
  Coverage   84.78%   84.78%           
=======================================
  Files         297      297           
  Lines       13969    13969           
  Branches     1955     1955           
=======================================
  Hits        11843    11843           
  Misses       2118     2118           
  Partials        8        8           
Flag Coverage Δ
backend 92.45% <ø> (ø)
frontend 79.39% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@karlnaden karlnaden requested review from arunkumarhk and ljtucker May 22, 2026 18:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant